package com.cango.student.proxy.jdk;

import com.cango.student.proxy.staticproxy.InterfaceA;
import com.cango.student.proxy.staticproxy.RealImplement;

import java.lang.reflect.Proxy;

public class JDKProxyTest {
    public static void main(String[] args) {
//        Thread.currentThread().getContextClassLoader()
        CustomizeHandle handle = new CustomizeHandle(RealImplement.class) ;
        // 用来指明生成代理对象使用哪个类装载器
        InterfaceA subject = (InterfaceA) Proxy.newProxyInstance(JDKProxyTest.class.getClassLoader(), new Class[]{InterfaceA.class}, handle);
        subject.exec();
    }
}
